<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <title>心理咨询预约系统</title>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="__USER__/js/layui/layui.js"></script>
    <link rel="stylesheet" href="__USER__/js/layui/css/layui.css">
    <link rel="stylesheet" href="__USER__/css/base.css">
    <link rel="stylesheet" href="__USER__/css/page/head.css">
    <link rel="stylesheet" href="__USER__/css/page/foot.css">
    <link rel="stylesheet" href="__USER__/css/page/index.css">
</head>


<body>
<div class="head-box">
    <div class="head-tit layui-row">
        <div class="headTit-inner layui-col-md-offset2 layui-col-md8">
            <div class="fl headTit-left">
                <div class="logo fl" style="margin-left: -40%">
                    <img src="__USER__/img/logo.png">
                </div>
                <div class="tit-txt fl" style="margin-left: -25%">
                    <div class="head-tit-bg"><a href="index.html">预约咨询服务平台</a></div>
                    <div class="head-tit-sm">预约诊疗服务平台</div>
                </div>
            </div>
            <div class="fr headTit-right layui-row" style="width: 500px">
                <ul>
                    <li class="layui-nav-item" style="margin-left:99%;margin-top:2%;width: 700px">
                        <a href="../expert/info.html"><span style="font-size: 14px; color: #010101">欢迎,   </span><span
                                style="font-size: 20px; color: #0f6bed">   {$Request.session.expertname}   </span> </a>
                        <a style="text-decoration: none" href="javascript:void(0);" onclick="message()"><i
                                class="layui-icon layui-icon-notice"
                                title="消息"><span style="font-size: 14px; color: #2BC807">({$xcount})</span></i></a>

                        <a href="../expert/logout"> <span style="font-size: 14px; color: #010101">    ,   退出</span></a>
                    </li>
                </ul>
                <div class="layui-row">

                </div>
            </div>
        </div>
    </div>

    <div class="head-tab layui-row">
        <div class="headTab-inner layui-col-md-offset2 layui-col-md8">
            <ul class="headTab-ul" style="margin-left: 17%">
                <li>
                    <a href="info.html">个人中心</a>
                </li>
                <li>
                    <a href="myorder.html">我的预约</a>
                </li>
                <li>
                    <a href="message.html">查看留言</a>
                </li>
            </ul>
        </div>
    </div>
</div>
<hr class="hr20">

<div class="layui-form" style="font-size: 15px">
    <p style="font-family: 楷体;font-size: 25px;margin-left: 42%;margin-top: -450px">当前有（<span
            style="color: rgba(15,112,255,0.68)">{$count}</span>）条 <b>进行中</b> 的预约</p>

    <div style="margin-left: 16.5%">
        <div class="layui-inline">
            <table id="test" lay-filter="test" lay-data="{id: 'test'}"
                   style="border:1px solid black;margin: 0 auto;"></table>
        </div>
    </div>

</div>


<div class="layui-row">
    <div class="layui-col-md-offset2 layui-col-md8">
        <div class="cardTit">
            <!-- <span class="cardTit-tit">友情链接</span> -->
        </div>
        <div class="body-card">
            <div id="linkurl" class="link-box">
            </div>
        </div>
    </div>
    <div class="layui-col-md12 foot-about">
        <div class="about-box">
            <div><a href="aboutUs.html">关于我们</a></div>
            <span>|</span>
            <div><a href="yinsi.html">隐私条款</a></div>
            <span>|</span>
            <div><a href="contactUs.html">联系我们</a></div>
            <div class="clear"></div>
        </div>
        <div>Copyright © 2019 - 2025 WEDOCTOR. All Rights Reserved. 苏孙举 版权所有</div>
    </div>
</div>
<script>


    layui.use(['form', 'layer', 'jquery', 'table'], function () {
        var table = layui.table;
        $ = layui.jquery;
        var form = layui.form,
            layer = layui.layer;

        var flag = 0;

        //检查设置默认图片
        $(document).ready(function () {
            //消息检测
            if (flag == 0) {
                $.ajax({
                    type: "get",
                    url: "{:url('Expert/checkmessage')}",
                    async: false,
                    success: function (data) {
                        //   console.log(data);
                        if (data != 0) {
                            layer.msg("您有（" + data + "）条新信息，请注意查看！");
                            flag = 1;
                        }
                    }
                });
            }
        });
    });

    //消息显示
    function message() {
        layer.open({
            type: 2,
            title: '',
            shadeClose: true,
            shade: 0.7,
            area: ['809px', '500px'],
            content: ['notify'],
            end: function () {
                $.ajax({
                    type: "get",
                    url: "{:url('Expert/changenotify')}",
                    async: false,
                    success: function (data) {
                        console.log(data);
                        //考虑读完之后数字为0
                    }
                });
            }
        });
    }

    layui.use('table', function () {
        var table = layui.table;
        table.render({
            // even: false //开启隔行背景
            // , size: 'sm' //小尺寸的表格
            // , toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
            minheight: "500px"
            , elem: '#test'
            , page: true
            , id: 'searchreload'
            , limit: 10
            , height: 450
            , width: 1000
            , url: "{:url('Expert/messagejson')}"
            , parseData: function (res) { //res 即为原始返回的数据
                return {
                    "code": 0, //解析接口状态
                    "msg": "刷新页面试试", //解析提示文本
                    "count": res.total, //解析数据长度
                    "data": res.data//解析数据列表
                };

            },
            cols: [[
                {field: 'content', title: '留言内容', width: 750}
                , {field: 'time', title: '留言时间', width: 245, sort: true}
            ]],
            done: function (res) {
               // clearnotify();
            }

        });
    });


    //显示消息之后 执行回调函数 不在提示新消息
    function clearnotify() {
        $.ajax({
            type: "get",
            url: "{:url('Expert/changenotify')}",
            async: false,
            success: function (data) {
                console.log(data);
                //考虑读完之后数字为0
            }
        });
    }

</script>
</body>
</html>